﻿@{
    ViewBag.WLTGongZuoGuanLiView = "active";
    ViewBag.Title = "工作管理";
    Layout = "~/Views/Shared/_layout_wenlvting.cshtml";
}

<div class="sousuo">
    <label>类型</label>
    <select id="sel_bbtype" class="sou_width" onchange="change_dttype();" v-model="bblx">
        <option value="-1">全部</option>
        <option value="1">月报</option>
        <option value="2">年报</option>
    </select>
    <div class="sou_tj02 sou_mar">
        <select class="sou_width02" v-model="shenheid">
            <option value="-1">全部</option>
            <option value="0">待审核</option>
            <option value="1">已审核</option>
            <option value="2">已退回</option>
        </select>
    </div>
    <div class="sou_tj02 ">
        <input type="text" required="required" placeholder="酒店模糊信息" class="gao02">
    </div>

    <div class="work_top">
        <input type="text" id="inp_bbdate1" placeholder="yyyy-mm-dd" class="time_hight02">
        <label id="lb_bbdate">至</label>
        <input type="text" id="inp_bbdate2" placeholder="yyyy-mm-dd" class="time_hight02">
    </div>

    <div class="sou_tj03 sou_mar02">
        <button class="sou_btn02" v-on:click="GetZTInfoP(-2)"> 搜索</button>
    </div>
</div>
<div class="tab_fill">
    <table width="95%" border="0" cellspacing="0" cellpadding="0" class="tab_tb">
        <tr>
            <td class="top_bt bt_w10">发布时间</td>
            <td class="top_bt bt_w10">截止日期</td>
            <td class="top_bt bt_w10">填报日期</td>
            <td class="top_bt ">酒店名称</td>
            <td class="top_bt bt_w10">运营状态</td>
            <td class="top_bt bt_w10">报表名称</td>
            <td class="top_bt bt_w10">进度</td>
            <td class="top_bt bt_w5">审核人</td>
            <td class="top_bt bt_w5 ">操作</td>
        </tr>
        <tr v-for="(item,index) in liszt">
            <td>{{item.dt_fabu}}</td>
            <td>{{item.dt_jiezhi}}</td>
            <td>{{item.dt_tianbao}}</td>
            <td>{{item.jd_name}}</td>
            <td>{{item.zt_yunying_str}}</td>
            <td>{{item.bbname}}</td>
            <td>{{item.zt_shenhe_str}}</td>
            <td>{{item.yywltid_name}}</td>
            <td>
                <button class="btn btn-primary btn-xs" v-on:click="WLTBaoBiaoShow(item.bbztid)">查看</button>
            </td>
        </tr>
    </table>
</div>
<div style="text-align:center;margin-top:20px; margin-bottom:20px;" v-html="pageHtml"></div>
<div v-if="msg!=''" style="text-align:center;margin-top:20px; margin-bottom:20px; color:gray">{{msg}}</div>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            shenheid: -1,
            bblx:-1,
            pageHtml: "",
            msg: "",
            liszt: [],
            txtsearch: "",

        },
        methods: {
            WLTBaoBiaoShow: function (bbztid) {
                to_url("/WenLvTing/WLTBaoBiaoShow?bbztid=" + bbztid);
            }
        }
    })

    $(function () {
        GetZTInfoP(-2);
        laydate.render({
            elem: '#inp_bbdate1'
            , type: 'date'
        });
        laydate.render({
            elem: '#inp_bbdate2'
            , type: 'date'
        });
    });
    function GetZTInfoP(init, pageIndex, pageSize) {
        
        if (init == -2) {
            vm.msg = "";
            pageIndex = 1;
            pageSize = 10;
        }
        bbdate1 = $("#inp_bbdate1").val();
        bbdate2 = $("#inp_bbdate2").val();
        
        var pa = { pageIndex: pageIndex, pageSize: pageSize, txtsearch: vm.txtsearch, shenheid: vm.shenheid, bbdate1: bbdate1, bbdate2: bbdate2,bblx:vm.bblx };
        $.post("/WenLvTing/GetZTInfoP", pa, function (res) {
            vm.pageHtml = res.pageHtml;
            vm.liszt = res.liszt;
            if (vm.liszt.length <= 0) {
                vm.msg = "没有查询到任何数据！";
            }
            else {
                vm.msg = "";
            }
        });
    }
    function change_dttype() {
        $("#inp_bbdate1").remove();
        $("#inp_bbdate2").remove();
        $("#lb_bbdate").before('<input id="inp_bbdate1" type="text" placeholder="请选择报表时间" class="sou_width">');
        $("#lb_bbdate").after('<input id="inp_bbdate2" type="text" placeholder="请选择报表时间" class="sou_width">');
        var bbtype = $("#sel_bbtype option:selected").val();
        if (bbtype == -1) {
            laydate.render({
                elem: '#inp_bbdate1'
                , type: 'date'
            });
            laydate.render({
                elem: '#inp_bbdate2'
                , type: 'date'
            });
        }
        else if (bbtype == 1) {
            laydate.render({
                elem: '#inp_bbdate1'
                , type: 'month'
            });
            laydate.render({
                elem: '#inp_bbdate2'
                , type: 'month'
            });
        }
        else if (bbtype == 2) {
            laydate.render({
                elem: '#inp_bbdate1'
                , type: 'year'
            });
            laydate.render({
                elem: '#inp_bbdate2'
                , type: 'year'
            });
        }
    }
</script>
